<template>
  <!-- LED展示 -->
  <div class="LEDShow">
    <div class="title">
      <Title> LED展示 </Title>
    </div>
    <div class="body">
      <!--      <div class="item"></div>-->
      <!--      <div class="item item1"></div>-->
      <div class="TextContent" v-if="type == '0'">
        {{ textContent }}
      </div>
      <div class="Picturebox" v-if="type == '1'">
        <el-image
          style="width: 100px; height: 100px"
          :src="picSrc"
          fit="fill"
        ></el-image>
      </div>
      <div v-if="type == '2'">
        <video width="320" height="240" autoplay :src="VideoSrc"></video>
      </div>
    </div>
  </div>
</template>

<script>
import Title from "./Title.vue";
import { GetBigScreenUrl } from "@/api/BigScreen";
export default {
  created() {
    GetBigScreenUrl().then((res) => {
      this.$store.commit("BigScreen/SET_Big_Screen_Info", res.data);
      this.type = res.data.ledInfo.ledLog.type;
      this.textContent = res.data.ledInfo.ledLog.text_content;
      this.picSrc = res.data.ledInfo.ledLog.pic_url;
      this.VideoSrc = res.data.ledInfo.ledLog.video_url;
    });
  },
  mounted() {
    console.log(this.$store.state.BigScreen.BigScreenInfo);
  },
  data() {
    return {
      picSrc: "",
      type: "",
      textContent: "",
      VideoSrc: "",
    };
  },
  components: {
    Title,
  },
};
</script>

<style lang="scss" scoped>
.LEDShow {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  .el-image {
    width: 100% !important;
    height: 100% !important;
  }
  .title {
    width: 100%;
    flex: 1;
  }
  .body {
    .TextContent {
      font-size: 18px;
      color: white;
    }
    .Picturebox {
      width: 100%;
      height: 100%;
    }
    width: 100%;
    height: 3.5rem;
    //flex: 6;
    padding: 0.3375rem /* 27/80 */ 0.3375rem /* 27/80 */ 0.2rem /* 16/80 */
      0.3125rem /* 25/80 */;
    display: flex;
    .item {
      flex: 1;
      background: url(../../../assets/Home/mengban.png);
      background-size: 100% 100%;
      overflow: hidden;
    }
    .item1 {
      margin-left: 0.2rem /* 16/80 */;
    }
  }
}
</style>
